[#import "/framework/JGP.htm"  as JGP]
<!--
项目   glSystem
作者   fdp
时间   2018/8/8
-->
[@JGP.head "Title"/]
[@JGP.body]
<jgp-div slot="2-1" _row="['8','*']" _aux="true">
    <jgp-div slot="1-1" _col="['*','*','*']" _aux="false" >
        <jgp-query slot="1-1"  _target="grid" _id="query" _auto="false" _page_size="12">
            <jgp-text   _col="8" _placeholder="搜索通知" _name="informTitle" ></jgp-text>
            <jgp-btn  _fn="search" _margin="5" _icon="search">搜索</jgp-btn>
        </jgp-query>
        <jgp-btn slot="1-2" _margin="5" _fn="addInform">新建通知</jgp-btn>
    </jgp-div>

    <jgp-grid  _id="grid" slot="2-1"  _record_tools="[{'icon':'envelope-open-o','tip':'发布通知','fn':'sendInform'},{'icon':'edit','tip':'编辑','fn':'editInform'},{'icon':'window-restore','fn':'addFields'},{'icon':'times-rectangle','tip':'删除','fn':'removeInform'}]"
               _index="true"></jgp-grid>
</jgp-div>
[/@JGP.body]

[@JGP.foot]
<script>
    //页面渲染完成之后调用,列表初始化
    JGP.$onload(search())
    //手动搜索
    function search() {
        JGP.query('query').searchTo('/glMeeting/informApiController/queryInforms',function () {
        },function () {
        });
    }
    //新建通知
    function addInform(re) {
        var config = {
            url:'/glMeeting/informController/addInform',
            title:"新建通知",
            callback:function(res){
                if(res==true){
                    window.location.reload();
                }
            },
            width:'700px',
            height:'500px'
        }
        JGP.$dialog(config)
    }

    //编辑通知
    function editInform(re){
        var config = {
            url:'/glMeeting/informController/editInform/'+re.back.id,
            title:"编辑通知",
            callback:function(res){
                if(res==true){
                    window.location.reload();
                }
            },
            width:'700px',
            height:'500px'
        }
        JGP.$dialog(config)
    }

    //删除通知
    function removeInform(re) {
        JGP.$confirm("是否确认删除",function () {
            JGP.$post('/glMeeting/informApiController/removeInform',{id:re.back.id},function (res) {
                JGP.$alert("删除成功")
                if (res.flag==true) {
                    window.location.reload();
                }
            })
        })
    }

</script>
[/@JGP.foot]